<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - tools/caffe.cpp</title>
  <link rel="stylesheet" type="text/css" href="../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../index.html">top level</a> - <a href="index.html">tools</a> - caffe.cpp<span style="font-size: 80%;"> (source / <a href="caffe.cpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">70</td>
            <td class="headerCovTableEntry">200</td>
            <td class="headerCovTableEntryLo">35.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:25:26</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">11</td>
            <td class="headerCovTableEntry">16</td>
            <td class="headerCovTableEntryLo">68.8 %</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : #ifdef WITH_PYTHON_LAYER</a>
<span class="lineNum">       2 </span>            : #include &quot;boost/python.hpp&quot;
<span class="lineNum">       3 </span>            : namespace bp = boost::python;
<span class="lineNum">       4 </span>            : #endif
<span class="lineNum">       5 </span>            : 
<span class="lineNum">       6 </span>            : #include &lt;gflags/gflags.h&gt;
<span class="lineNum">       7 </span>            : #include &lt;glog/logging.h&gt;
<span class="lineNum">       8 </span>            : 
<span class="lineNum">       9 </span>            : #include &lt;cstring&gt;
<span class="lineNum">      10 </span>            : #include &lt;map&gt;
<span class="lineNum">      11 </span>            : #include &lt;string&gt;
<span class="lineNum">      12 </span>            : #include &lt;vector&gt;
<span class="lineNum">      13 </span>            : 
<span class="lineNum">      14 </span>            : #include &quot;boost/algorithm/string.hpp&quot;
<span class="lineNum">      15 </span>            : #include &quot;caffe/caffe.hpp&quot;
<span class="lineNum">      16 </span>            : #include &quot;caffe/util/signal_handler.h&quot;
<span class="lineNum">      17 </span>            : 
<span class="lineNum">      18 </span>            : using caffe::Blob;
<span class="lineNum">      19 </span>            : using caffe::Caffe;
<span class="lineNum">      20 </span>            : using caffe::Net;
<span class="lineNum">      21 </span>            : using caffe::Layer;
<span class="lineNum">      22 </span>            : using caffe::Solver;
<span class="lineNum">      23 </span>            : using caffe::shared_ptr;
<span class="lineNum">      24 </span>            : using caffe::string;
<span class="lineNum">      25 </span>            : using caffe::Timer;
<span class="lineNum">      26 </span>            : using caffe::vector;
<span class="lineNum">      27 </span>            : using std::ostringstream;
<span class="lineNum">      28 </span>            : 
<span class="lineNum">      29 </span><span class="lineCov">          2 : DEFINE_string(gpu, &quot;&quot;,</span>
<span class="lineNum">      30 </span>            :     &quot;Optional; run in GPU mode on given device IDs separated by ','.&quot;
<span class="lineNum">      31 </span>            :     &quot;Use '-gpu all' to run on all available GPUs. The effective training &quot;
<span class="lineNum">      32 </span>            :     &quot;batch size is multiplied by the number of devices.&quot;);
<span class="lineNum">      33 </span><span class="lineCov">          2 : DEFINE_string(solver, &quot;&quot;,</span>
<span class="lineNum">      34 </span>            :     &quot;The solver definition protocol buffer text file.&quot;);
<span class="lineNum">      35 </span><span class="lineCov">          2 : DEFINE_string(model, &quot;&quot;,</span>
<span class="lineNum">      36 </span>            :     &quot;The model definition protocol buffer text file.&quot;);
<span class="lineNum">      37 </span><span class="lineCov">          2 : DEFINE_string(phase, &quot;&quot;,</span>
<span class="lineNum">      38 </span>            :     &quot;Optional; network phase (TRAIN or TEST). Only used for 'time'.&quot;);
<span class="lineNum">      39 </span><span class="lineCov">          1 : DEFINE_int32(level, 0,</span>
<span class="lineNum">      40 </span>            :     &quot;Optional; network level.&quot;);
<span class="lineNum">      41 </span><span class="lineCov">          2 : DEFINE_string(stage, &quot;&quot;,</span>
<span class="lineNum">      42 </span>            :     &quot;Optional; network stages (not to be confused with phase), &quot;
<span class="lineNum">      43 </span>            :     &quot;separated by ','.&quot;);
<span class="lineNum">      44 </span><span class="lineCov">          2 : DEFINE_string(snapshot, &quot;&quot;,</span>
<span class="lineNum">      45 </span>            :     &quot;Optional; the snapshot solver state to resume training.&quot;);
<span class="lineNum">      46 </span><span class="lineCov">          2 : DEFINE_string(weights, &quot;&quot;,</span>
<span class="lineNum">      47 </span>            :     &quot;Optional; the pretrained weights to initialize finetuning, &quot;
<span class="lineNum">      48 </span>            :     &quot;separated by ','. Cannot be set simultaneously with snapshot.&quot;);
<span class="lineNum">      49 </span><span class="lineCov">          1 : DEFINE_int32(iterations, 50,</span>
<span class="lineNum">      50 </span>            :     &quot;The number of iterations to run.&quot;);
<span class="lineNum">      51 </span><span class="lineCov">          2 : DEFINE_string(sigint_effect, &quot;stop&quot;,</span>
<span class="lineNum">      52 </span>            :              &quot;Optional; action to take when a SIGINT signal is received: &quot;
<span class="lineNum">      53 </span>            :               &quot;snapshot, stop or none.&quot;);
<span class="lineNum">      54 </span><span class="lineCov">          2 : DEFINE_string(sighup_effect, &quot;snapshot&quot;,</span>
<span class="lineNum">      55 </span>            :              &quot;Optional; action to take when a SIGHUP signal is received: &quot;
<span class="lineNum">      56 </span>            :              &quot;snapshot, stop or none.&quot;);
<span class="lineNum">      57 </span>            : 
<span class="lineNum">      58 </span>            : // A simple registry for caffe commands.
<span class="lineNum">      59 </span>            : typedef int (*BrewFunction)();
<span class="lineNum">      60 </span>            : typedef std::map&lt;caffe::string, BrewFunction&gt; BrewMap;
<span class="lineNum">      61 </span><span class="lineCov">          1 : BrewMap g_brew_map;</span>
<span class="lineNum">      62 </span>            : 
<span class="lineNum">      63 </span>            : #define RegisterBrewFunction(func) \
<span class="lineNum">      64 </span>            : namespace { \
<span class="lineNum">      65 </span>            : class __Registerer_##func { \
<span class="lineNum">      66 </span>            :  public: /* NOLINT */ \
<span class="lineNum">      67 </span>            :   __Registerer_##func() { \
<span class="lineNum">      68 </span>            :     g_brew_map[#func] = &amp;func; \
<span class="lineNum">      69 </span>            :   } \
<span class="lineNum">      70 </span>            : }; \
<span class="lineNum">      71 </span>            : __Registerer_##func g_registerer_##func; \
<span class="lineNum">      72 </span>            : }
<span class="lineNum">      73 </span>            : 
<span class="lineNum">      74 </span><span class="lineCov">          1 : static BrewFunction GetBrewFunction(const caffe::string&amp; name) {</span>
<span class="lineNum">      75 </span><span class="lineCov">          1 :   if (g_brew_map.count(name)) {</span>
<span class="lineNum">      76 </span><span class="lineCov">          1 :     return g_brew_map[name];</span>
<span class="lineNum">      77 </span>            :   } else {
<span class="lineNum">      78 </span><span class="lineNoCov">          0 :     LOG(ERROR) &lt;&lt; &quot;Available caffe actions:&quot;;</span>
<span class="lineNum">      79 </span><span class="lineNoCov">          0 :     for (BrewMap::iterator it = g_brew_map.begin();</span>
<span class="lineNum">      80 </span>            :          it != g_brew_map.end(); ++it) {
<span class="lineNum">      81 </span><span class="lineNoCov">          0 :       LOG(ERROR) &lt;&lt; &quot;\t&quot; &lt;&lt; it-&gt;first;</span>
<span class="lineNum">      82 </span>            :     }
<span class="lineNum">      83 </span><span class="lineNoCov">          0 :     LOG(FATAL) &lt;&lt; &quot;Unknown action: &quot; &lt;&lt; name;</span>
<span class="lineNum">      84 </span>            :     return NULL;  // not reachable, just to suppress old compiler warnings.
<span class="lineNum">      85 </span>            :   }
<span class="lineNum">      86 </span>            : }
<span class="lineNum">      87 </span>            : 
<span class="lineNum">      88 </span>            : // Parse GPU ids or use all available devices
<span class="lineNum">      89 </span><span class="lineCov">          1 : static void get_gpus(vector&lt;int&gt;* gpus) {</span>
<span class="lineNum">      90 </span><span class="lineCov">          2 :   if (FLAGS_gpu == &quot;all&quot;) {</span>
<span class="lineNum">      91 </span>            :     int count = 0;
<span class="lineNum">      92 </span>            : #ifndef CPU_ONLY
<span class="lineNum">      93 </span>            :     CUDA_CHECK(cudaGetDeviceCount(&amp;count));
<span class="lineNum">      94 </span>            : #else
<span class="lineNum">      95 </span><span class="lineNoCov">          0 :     NO_GPU;</span>
<span class="lineNum">      96 </span>            : #endif
<span class="lineNum">      97 </span>            :     for (int i = 0; i &lt; count; ++i) {
<span class="lineNum">      98 </span>            :       gpus-&gt;push_back(i);
<span class="lineNum">      99 </span>            :     }
<span class="lineNum">     100 </span><span class="lineCov">          1 :   } else if (FLAGS_gpu.size()) {</span>
<span class="lineNum">     101 </span><span class="lineNoCov">          0 :     vector&lt;string&gt; strings;</span>
<span class="lineNum">     102 </span><span class="lineNoCov">          0 :     boost::split(strings, FLAGS_gpu, boost::is_any_of(&quot;,&quot;));</span>
<span class="lineNum">     103 </span><span class="lineNoCov">          0 :     for (int i = 0; i &lt; strings.size(); ++i) {</span>
<span class="lineNum">     104 </span><span class="lineNoCov">          0 :       gpus-&gt;push_back(boost::lexical_cast&lt;int&gt;(strings[i]));</span>
<span class="lineNum">     105 </span>            :     }
<span class="lineNum">     106 </span>            :   } else {
<span class="lineNum">     107 </span><span class="lineCov">          4 :     CHECK_EQ(gpus-&gt;size(), 0);</span>
<span class="lineNum">     108 </span>            :   }
<span class="lineNum">     109 </span><span class="lineCov">          1 : }</span>
<span class="lineNum">     110 </span>            : 
<span class="lineNum">     111 </span>            : // Parse phase from flags
<span class="lineNum">     112 </span><span class="lineNoCov">          0 : caffe::Phase get_phase_from_flags(caffe::Phase default_value) {</span>
<span class="lineNum">     113 </span><span class="lineNoCov">          0 :   if (FLAGS_phase == &quot;&quot;)</span>
<span class="lineNum">     114 </span>            :     return default_value;
<span class="lineNum">     115 </span><span class="lineNoCov">          0 :   if (FLAGS_phase == &quot;TRAIN&quot;)</span>
<span class="lineNum">     116 </span>            :     return caffe::TRAIN;
<span class="lineNum">     117 </span><span class="lineNoCov">          0 :   if (FLAGS_phase == &quot;TEST&quot;)</span>
<span class="lineNum">     118 </span>            :     return caffe::TEST;
<span class="lineNum">     119 </span><span class="lineNoCov">          0 :   LOG(FATAL) &lt;&lt; &quot;phase must be \&quot;TRAIN\&quot; or \&quot;TEST\&quot;&quot;;</span>
<span class="lineNum">     120 </span>            :   return caffe::TRAIN;  // Avoid warning
<span class="lineNum">     121 </span>            : }
<a name="122"><span class="lineNum">     122 </span>            : </a>
<span class="lineNum">     123 </span>            : // Parse stages from flags
<span class="lineNum">     124 </span><span class="lineCov">          1 : vector&lt;string&gt; get_stages_from_flags() {</span>
<span class="lineNum">     125 </span>            :   vector&lt;string&gt; stages;
<span class="lineNum">     126 </span><span class="lineCov">          1 :   boost::split(stages, FLAGS_stage, boost::is_any_of(&quot;,&quot;));</span>
<span class="lineNum">     127 </span><span class="lineCov">          1 :   return stages;</span>
<span class="lineNum">     128 </span>            : }
<span class="lineNum">     129 </span>            : 
<span class="lineNum">     130 </span>            : // caffe commands to call by
<span class="lineNum">     131 </span>            : //     caffe &lt;command&gt; &lt;args&gt;
<span class="lineNum">     132 </span>            : //
<span class="lineNum">     133 </span>            : // To add a command, define a function &quot;int command()&quot; and register it with
<span class="lineNum">     134 </span>            : // RegisterBrewFunction(action);
<span class="lineNum">     135 </span>            : 
<span class="lineNum">     136 </span>            : // Device Query: show diagnostic information for a GPU device.
<span class="lineNum">     137 </span><span class="lineNoCov">          0 : int device_query() {</span>
<span class="lineNum">     138 </span><span class="lineNoCov">          0 :   LOG(INFO) &lt;&lt; &quot;Querying GPUs &quot; &lt;&lt; FLAGS_gpu;</span>
<span class="lineNum">     139 </span>            :   vector&lt;int&gt; gpus;
<span class="lineNum">     140 </span><span class="lineNoCov">          0 :   get_gpus(&amp;gpus);</span>
<span class="lineNum">     141 </span><span class="lineNoCov">          0 :   for (int i = 0; i &lt; gpus.size(); ++i) {</span>
<span class="lineNum">     142 </span><span class="lineNoCov">          0 :     caffe::Caffe::SetDevice(gpus[i]);</span>
<span class="lineNum">     143 </span><span class="lineNoCov">          0 :     caffe::Caffe::DeviceQuery();</span>
<span class="lineNum">     144 </span>            :   }
<span class="lineNum">     145 </span><span class="lineNoCov">          0 :   return 0;</span>
<span class="lineNum">     146 </span>            : }
<span class="lineNum">     147 </span><span class="lineCov">          3 : RegisterBrewFunction(device_query);</span>
<span class="lineNum">     148 </span>            : 
<span class="lineNum">     149 </span>            : // Translate the signal effect the user specified on the command-line to the
<span class="lineNum">     150 </span>            : // corresponding enumeration.
<span class="lineNum">     151 </span><span class="lineNoCov">          0 : caffe::SolverAction::Enum GetRequestedAction(</span>
<span class="lineNum">     152 </span>            :     const std::string&amp; flag_value) {
<span class="lineNum">     153 </span><span class="lineNoCov">          0 :   if (flag_value == &quot;stop&quot;) {</span>
<span class="lineNum">     154 </span>            :     return caffe::SolverAction::STOP;
<span class="lineNum">     155 </span>            :   }
<span class="lineNum">     156 </span><span class="lineNoCov">          0 :   if (flag_value == &quot;snapshot&quot;) {</span>
<span class="lineNum">     157 </span>            :     return caffe::SolverAction::SNAPSHOT;
<span class="lineNum">     158 </span>            :   }
<span class="lineNum">     159 </span><span class="lineNoCov">          0 :   if (flag_value == &quot;none&quot;) {</span>
<span class="lineNum">     160 </span>            :     return caffe::SolverAction::NONE;
<span class="lineNum">     161 </span>            :   }
<span class="lineNum">     162 </span><span class="lineNoCov">          0 :   LOG(FATAL) &lt;&lt; &quot;Invalid signal effect \&quot;&quot;&lt;&lt; flag_value &lt;&lt; &quot;\&quot; was specified&quot;;</span>
<span class="lineNum">     163 </span>            : }
<span class="lineNum">     164 </span>            : 
<span class="lineNum">     165 </span>            : // Train / Finetune a model.
<span class="lineNum">     166 </span><span class="lineNoCov">          0 : int train() {</span>
<span class="lineNum">     167 </span><span class="lineNoCov">          0 :   CHECK_GT(FLAGS_solver.size(), 0) &lt;&lt; &quot;Need a solver definition to train.&quot;;</span>
<span class="lineNum">     168 </span><span class="lineNoCov">          0 :   CHECK(!FLAGS_snapshot.size() || !FLAGS_weights.size())</span>
<span class="lineNum">     169 </span>            :       &lt;&lt; &quot;Give a snapshot to resume training or weights to finetune &quot;
<span class="lineNum">     170 </span><span class="lineNoCov">          0 :       &quot;but not both.&quot;;</span>
<span class="lineNum">     171 </span><span class="lineNoCov">          0 :   vector&lt;string&gt; stages = get_stages_from_flags();</span>
<span class="lineNum">     172 </span>            : 
<span class="lineNum">     173 </span><span class="lineNoCov">          0 :   caffe::SolverParameter solver_param;</span>
<span class="lineNum">     174 </span><span class="lineNoCov">          0 :   caffe::ReadSolverParamsFromTextFileOrDie(FLAGS_solver, &amp;solver_param);</span>
<span class="lineNum">     175 </span>            : 
<span class="lineNum">     176 </span><span class="lineNoCov">          0 :   solver_param.mutable_train_state()-&gt;set_level(FLAGS_level);</span>
<span class="lineNum">     177 </span><span class="lineNoCov">          0 :   for (int i = 0; i &lt; stages.size(); i++) {</span>
<span class="lineNum">     178 </span><span class="lineNoCov">          0 :     solver_param.mutable_train_state()-&gt;add_stage(stages[i]);</span>
<span class="lineNum">     179 </span>            :   }
<span class="lineNum">     180 </span>            : 
<span class="lineNum">     181 </span>            :   // If the gpus flag is not provided, allow the mode and device to be set
<span class="lineNum">     182 </span>            :   // in the solver prototxt.
<span class="lineNum">     183 </span><span class="lineNoCov">          0 :   if (FLAGS_gpu.size() == 0</span>
<span class="lineNum">     184 </span><span class="lineNoCov">          0 :       &amp;&amp; solver_param.has_solver_mode()</span>
<span class="lineNum">     185 </span><span class="lineNoCov">          0 :       &amp;&amp; solver_param.solver_mode() == caffe::SolverParameter_SolverMode_GPU) {</span>
<span class="lineNum">     186 </span><span class="lineNoCov">          0 :       if (solver_param.has_device_id()) {</span>
<span class="lineNum">     187 </span><span class="lineNoCov">          0 :           FLAGS_gpu = &quot;&quot; +</span>
<span class="lineNum">     188 </span><span class="lineNoCov">          0 :               boost::lexical_cast&lt;string&gt;(solver_param.device_id());</span>
<span class="lineNum">     189 </span>            :       } else {  // Set default GPU if unspecified
<span class="lineNum">     190 </span><span class="lineNoCov">          0 :           FLAGS_gpu = &quot;&quot; + boost::lexical_cast&lt;string&gt;(0);</span>
<span class="lineNum">     191 </span>            :       }
<span class="lineNum">     192 </span>            :   }
<span class="lineNum">     193 </span>            : 
<span class="lineNum">     194 </span>            :   vector&lt;int&gt; gpus;
<span class="lineNum">     195 </span><span class="lineNoCov">          0 :   get_gpus(&amp;gpus);</span>
<span class="lineNum">     196 </span><span class="lineNoCov">          0 :   if (gpus.size() == 0) {</span>
<span class="lineNum">     197 </span><span class="lineNoCov">          0 :     LOG(INFO) &lt;&lt; &quot;Use CPU.&quot;;</span>
<span class="lineNum">     198 </span>            :     Caffe::set_mode(Caffe::CPU);
<span class="lineNum">     199 </span>            :   } else {
<span class="lineNum">     200 </span><span class="lineNoCov">          0 :     ostringstream s;</span>
<span class="lineNum">     201 </span><span class="lineNoCov">          0 :     for (int i = 0; i &lt; gpus.size(); ++i) {</span>
<span class="lineNum">     202 </span><span class="lineNoCov">          0 :       s &lt;&lt; (i ? &quot;, &quot; : &quot;&quot;) &lt;&lt; gpus[i];</span>
<span class="lineNum">     203 </span>            :     }
<span class="lineNum">     204 </span><span class="lineNoCov">          0 :     LOG(INFO) &lt;&lt; &quot;Using GPUs &quot; &lt;&lt; s.str();</span>
<span class="lineNum">     205 </span>            : #ifndef CPU_ONLY
<span class="lineNum">     206 </span>            :     cudaDeviceProp device_prop;
<span class="lineNum">     207 </span>            :     for (int i = 0; i &lt; gpus.size(); ++i) {
<span class="lineNum">     208 </span>            :       cudaGetDeviceProperties(&amp;device_prop, gpus[i]);
<span class="lineNum">     209 </span>            :       LOG(INFO) &lt;&lt; &quot;GPU &quot; &lt;&lt; gpus[i] &lt;&lt; &quot;: &quot; &lt;&lt; device_prop.name;
<span class="lineNum">     210 </span>            :     }
<span class="lineNum">     211 </span>            : #endif
<span class="lineNum">     212 </span><span class="lineNoCov">          0 :     solver_param.set_device_id(gpus[0]);</span>
<span class="lineNum">     213 </span><span class="lineNoCov">          0 :     Caffe::SetDevice(gpus[0]);</span>
<span class="lineNum">     214 </span>            :     Caffe::set_mode(Caffe::GPU);
<span class="lineNum">     215 </span><span class="lineNoCov">          0 :     Caffe::set_solver_count(gpus.size());</span>
<span class="lineNum">     216 </span>            :   }
<span class="lineNum">     217 </span>            : 
<span class="lineNum">     218 </span>            :   caffe::SignalHandler signal_handler(
<span class="lineNum">     219 </span>            :         GetRequestedAction(FLAGS_sigint_effect),
<span class="lineNum">     220 </span><span class="lineNoCov">          0 :         GetRequestedAction(FLAGS_sighup_effect));</span>
<span class="lineNum">     221 </span>            : 
<span class="lineNum">     222 </span><span class="lineNoCov">          0 :   if (FLAGS_snapshot.size()) {</span>
<span class="lineNum">     223 </span>            :     solver_param.clear_weights();
<span class="lineNum">     224 </span><span class="lineNoCov">          0 :   } else if (FLAGS_weights.size()) {</span>
<span class="lineNum">     225 </span>            :     solver_param.clear_weights();
<span class="lineNum">     226 </span><span class="lineNoCov">          0 :     solver_param.add_weights(FLAGS_weights);</span>
<span class="lineNum">     227 </span>            :   }
<span class="lineNum">     228 </span>            : 
<span class="lineNum">     229 </span>            :   shared_ptr&lt;caffe::Solver&lt;float&gt; &gt;
<span class="lineNum">     230 </span><span class="lineNoCov">          0 :       solver(caffe::SolverRegistry&lt;float&gt;::CreateSolver(solver_param));</span>
<span class="lineNum">     231 </span>            : 
<span class="lineNum">     232 </span><span class="lineNoCov">          0 :   solver-&gt;SetActionFunction(signal_handler.GetActionFunction());</span>
<span class="lineNum">     233 </span>            : 
<span class="lineNum">     234 </span><span class="lineNoCov">          0 :   if (FLAGS_snapshot.size()) {</span>
<span class="lineNum">     235 </span><span class="lineNoCov">          0 :     LOG(INFO) &lt;&lt; &quot;Resuming from &quot; &lt;&lt; FLAGS_snapshot;</span>
<span class="lineNum">     236 </span><span class="lineNoCov">          0 :     solver-&gt;Restore(FLAGS_snapshot.c_str());</span>
<span class="lineNum">     237 </span>            :   }
<span class="lineNum">     238 </span>            : 
<span class="lineNum">     239 </span><span class="lineNoCov">          0 :   LOG(INFO) &lt;&lt; &quot;Starting Optimization&quot;;</span>
<span class="lineNum">     240 </span><span class="lineNoCov">          0 :   if (gpus.size() &gt; 1) {</span>
<span class="lineNum">     241 </span>            : #ifdef USE_NCCL
<span class="lineNum">     242 </span>            :     caffe::NCCL&lt;float&gt; nccl(solver);
<span class="lineNum">     243 </span>            :     nccl.Run(gpus, FLAGS_snapshot.size() &gt; 0 ? FLAGS_snapshot.c_str() : NULL);
<span class="lineNum">     244 </span>            : #else
<span class="lineNum">     245 </span><span class="lineNoCov">          0 :     LOG(FATAL) &lt;&lt; &quot;Multi-GPU execution not available - rebuild with USE_NCCL&quot;;</span>
<span class="lineNum">     246 </span>            : #endif
<span class="lineNum">     247 </span>            :   } else {
<span class="lineNum">     248 </span><span class="lineNoCov">          0 :     solver-&gt;Solve();</span>
<span class="lineNum">     249 </span>            :   }
<span class="lineNum">     250 </span><span class="lineNoCov">          0 :   LOG(INFO) &lt;&lt; &quot;Optimization Done.&quot;;</span>
<span class="lineNum">     251 </span><span class="lineNoCov">          0 :   return 0;</span>
<span class="lineNum">     252 </span>            : }
<span class="lineNum">     253 </span><span class="lineCov">          3 : RegisterBrewFunction(train);</span>
<span class="lineNum">     254 </span>            : 
<span class="lineNum">     255 </span>            : 
<span class="lineNum">     256 </span>            : // Test: score a model.
<span class="lineNum">     257 </span><span class="lineCov">          1 : int test() {</span>
<span class="lineNum">     258 </span><span class="lineCov">          3 :   CHECK_GT(FLAGS_model.size(), 0) &lt;&lt; &quot;Need a model definition to score.&quot;;</span>
<span class="lineNum">     259 </span><span class="lineCov">          3 :   CHECK_GT(FLAGS_weights.size(), 0) &lt;&lt; &quot;Need model weights to score.&quot;;</span>
<span class="lineNum">     260 </span><span class="lineCov">          2 :   vector&lt;string&gt; stages = get_stages_from_flags();</span>
<span class="lineNum">     261 </span>            : 
<span class="lineNum">     262 </span>            :   // Set device id and mode
<span class="lineNum">     263 </span>            :   vector&lt;int&gt; gpus;
<span class="lineNum">     264 </span><span class="lineCov">          1 :   get_gpus(&amp;gpus);</span>
<span class="lineNum">     265 </span><span class="lineCov">          1 :   if (gpus.size() != 0) {</span>
<span class="lineNum">     266 </span><span class="lineNoCov">          0 :     LOG(INFO) &lt;&lt; &quot;Use GPU with device ID &quot; &lt;&lt; gpus[0];</span>
<span class="lineNum">     267 </span>            : #ifndef CPU_ONLY
<span class="lineNum">     268 </span>            :     cudaDeviceProp device_prop;
<span class="lineNum">     269 </span>            :     cudaGetDeviceProperties(&amp;device_prop, gpus[0]);
<span class="lineNum">     270 </span>            :     LOG(INFO) &lt;&lt; &quot;GPU device name: &quot; &lt;&lt; device_prop.name;
<span class="lineNum">     271 </span>            : #endif
<span class="lineNum">     272 </span><span class="lineNoCov">          0 :     Caffe::SetDevice(gpus[0]);</span>
<span class="lineNum">     273 </span>            :     Caffe::set_mode(Caffe::GPU);
<span class="lineNum">     274 </span>            :   } else {
<span class="lineNum">     275 </span><span class="lineCov">          1 :     LOG(INFO) &lt;&lt; &quot;Use CPU.&quot;;</span>
<span class="lineNum">     276 </span>            :     Caffe::set_mode(Caffe::CPU);
<span class="lineNum">     277 </span>            :   }
<span class="lineNum">     278 </span>            :   // Instantiate the caffe net.
<span class="lineNum">     279 </span><span class="lineCov">          2 :   Net&lt;float&gt; caffe_net(FLAGS_model, caffe::TEST, FLAGS_level, &amp;stages);</span>
<span class="lineNum">     280 </span><span class="lineCov">          1 :   caffe_net.CopyTrainedLayersFrom(FLAGS_weights);</span>
<span class="lineNum">     281 </span><span class="lineCov">          2 :   LOG(INFO) &lt;&lt; &quot;Running for &quot; &lt;&lt; FLAGS_iterations &lt;&lt; &quot; iterations.&quot;;</span>
<span class="lineNum">     282 </span>            : 
<span class="lineNum">     283 </span>            :   vector&lt;int&gt; test_score_output_id;
<span class="lineNum">     284 </span>            :   vector&lt;float&gt; test_score;
<span class="lineNum">     285 </span>            :   float loss = 0;
<span class="lineNum">     286 </span><span class="lineCov">        201 :   for (int i = 0; i &lt; FLAGS_iterations; ++i) {</span>
<span class="lineNum">     287 </span>            :     float iter_loss;
<span class="lineNum">     288 </span>            :     const vector&lt;Blob&lt;float&gt;*&gt;&amp; result =
<span class="lineNum">     289 </span><span class="lineCov">        100 :         caffe_net.Forward(&amp;iter_loss);</span>
<span class="lineNum">     290 </span><span class="lineCov">        100 :     loss += iter_loss;</span>
<span class="lineNum">     291 </span>            :     int idx = 0;
<span class="lineNum">     292 </span><span class="lineCov">        600 :     for (int j = 0; j &lt; result.size(); ++j) {</span>
<span class="lineNum">     293 </span><span class="lineCov">        200 :       const float* result_vec = result[j]-&gt;cpu_data();</span>
<span class="lineNum">     294 </span><span class="lineCov">       1000 :       for (int k = 0; k &lt; result[j]-&gt;count(); ++k, ++idx) {</span>
<span class="lineNum">     295 </span><span class="lineCov">        200 :         const float score = result_vec[k];</span>
<span class="lineNum">     296 </span><span class="lineCov">        200 :         if (i == 0) {</span>
<span class="lineNum">     297 </span><span class="lineCov">          2 :           test_score.push_back(score);</span>
<span class="lineNum">     298 </span><span class="lineCov">          2 :           test_score_output_id.push_back(j);</span>
<span class="lineNum">     299 </span>            :         } else {
<span class="lineNum">     300 </span><span class="lineCov">        396 :           test_score[idx] += score;</span>
<span class="lineNum">     301 </span>            :         }
<span class="lineNum">     302 </span>            :         const std::string&amp; output_name = caffe_net.blob_names()[
<span class="lineNum">     303 </span><span class="lineCov">        400 :             caffe_net.output_blob_indices()[j]];</span>
<span class="lineNum">     304 </span><span class="lineCov">        600 :         LOG(INFO) &lt;&lt; &quot;Batch &quot; &lt;&lt; i &lt;&lt; &quot;, &quot; &lt;&lt; output_name &lt;&lt; &quot; = &quot; &lt;&lt; score;</span>
<span class="lineNum">     305 </span>            :       }
<span class="lineNum">     306 </span>            :     }
<span class="lineNum">     307 </span>            :   }
<span class="lineNum">     308 </span><span class="lineCov">          1 :   loss /= FLAGS_iterations;</span>
<span class="lineNum">     309 </span><span class="lineCov">          2 :   LOG(INFO) &lt;&lt; &quot;Loss: &quot; &lt;&lt; loss;</span>
<span class="lineNum">     310 </span><span class="lineCov">          8 :   for (int i = 0; i &lt; test_score.size(); ++i) {</span>
<span class="lineNum">     311 </span>            :     const std::string&amp; output_name = caffe_net.blob_names()[
<span class="lineNum">     312 </span><span class="lineCov">          4 :         caffe_net.output_blob_indices()[test_score_output_id[i]]];</span>
<span class="lineNum">     313 </span>            :     const float loss_weight = caffe_net.blob_loss_weights()[
<span class="lineNum">     314 </span><span class="lineCov">          2 :         caffe_net.output_blob_indices()[test_score_output_id[i]]];</span>
<span class="lineNum">     315 </span><span class="lineCov">          4 :     std::ostringstream loss_msg_stream;</span>
<span class="lineNum">     316 </span><span class="lineCov">          2 :     const float mean_score = test_score[i] / FLAGS_iterations;</span>
<span class="lineNum">     317 </span><span class="lineCov">          2 :     if (loss_weight) {</span>
<span class="lineNum">     318 </span>            :       loss_msg_stream &lt;&lt; &quot; (* &quot; &lt;&lt; loss_weight
<span class="lineNum">     319 </span><span class="lineCov">          2 :                       &lt;&lt; &quot; = &quot; &lt;&lt; loss_weight * mean_score &lt;&lt; &quot; loss)&quot;;</span>
<span class="lineNum">     320 </span>            :     }
<span class="lineNum">     321 </span><span class="lineCov">          6 :     LOG(INFO) &lt;&lt; output_name &lt;&lt; &quot; = &quot; &lt;&lt; mean_score &lt;&lt; loss_msg_stream.str();</span>
<span class="lineNum">     322 </span>            :   }
<span class="lineNum">     323 </span>            : 
<span class="lineNum">     324 </span><span class="lineCov">          1 :   return 0;</span>
<span class="lineNum">     325 </span>            : }
<span class="lineNum">     326 </span><span class="lineCov">          3 : RegisterBrewFunction(test);</span>
<span class="lineNum">     327 </span>            : 
<span class="lineNum">     328 </span>            : 
<span class="lineNum">     329 </span>            : // Time: benchmark the execution time of a model.
<span class="lineNum">     330 </span><span class="lineNoCov">          0 : int time() {</span>
<span class="lineNum">     331 </span><span class="lineNoCov">          0 :   CHECK_GT(FLAGS_model.size(), 0) &lt;&lt; &quot;Need a model definition to time.&quot;;</span>
<span class="lineNum">     332 </span><span class="lineNoCov">          0 :   caffe::Phase phase = get_phase_from_flags(caffe::TRAIN);</span>
<span class="lineNum">     333 </span><span class="lineNoCov">          0 :   vector&lt;string&gt; stages = get_stages_from_flags();</span>
<span class="lineNum">     334 </span>            : 
<span class="lineNum">     335 </span>            :   // Set device id and mode
<span class="lineNum">     336 </span>            :   vector&lt;int&gt; gpus;
<span class="lineNum">     337 </span><span class="lineNoCov">          0 :   get_gpus(&amp;gpus);</span>
<span class="lineNum">     338 </span><span class="lineNoCov">          0 :   if (gpus.size() != 0) {</span>
<span class="lineNum">     339 </span><span class="lineNoCov">          0 :     LOG(INFO) &lt;&lt; &quot;Use GPU with device ID &quot; &lt;&lt; gpus[0];</span>
<span class="lineNum">     340 </span><span class="lineNoCov">          0 :     Caffe::SetDevice(gpus[0]);</span>
<span class="lineNum">     341 </span>            :     Caffe::set_mode(Caffe::GPU);
<span class="lineNum">     342 </span>            :   } else {
<span class="lineNum">     343 </span><span class="lineNoCov">          0 :     LOG(INFO) &lt;&lt; &quot;Use CPU.&quot;;</span>
<span class="lineNum">     344 </span>            :     Caffe::set_mode(Caffe::CPU);
<span class="lineNum">     345 </span>            :   }
<span class="lineNum">     346 </span>            :   // Instantiate the caffe net.
<span class="lineNum">     347 </span><span class="lineNoCov">          0 :   Net&lt;float&gt; caffe_net(FLAGS_model, phase, FLAGS_level, &amp;stages);</span>
<span class="lineNum">     348 </span>            : 
<span class="lineNum">     349 </span>            :   // Do a clean forward and backward pass, so that memory allocation are done
<span class="lineNum">     350 </span>            :   // and future iterations will be more stable.
<span class="lineNum">     351 </span><span class="lineNoCov">          0 :   LOG(INFO) &lt;&lt; &quot;Performing Forward&quot;;</span>
<span class="lineNum">     352 </span>            :   // Note that for the speed benchmark, we will assume that the network does
<span class="lineNum">     353 </span>            :   // not take any input blobs.
<span class="lineNum">     354 </span>            :   float initial_loss;
<span class="lineNum">     355 </span><span class="lineNoCov">          0 :   caffe_net.Forward(&amp;initial_loss);</span>
<span class="lineNum">     356 </span><span class="lineNoCov">          0 :   LOG(INFO) &lt;&lt; &quot;Initial loss: &quot; &lt;&lt; initial_loss;</span>
<span class="lineNum">     357 </span><span class="lineNoCov">          0 :   LOG(INFO) &lt;&lt; &quot;Performing Backward&quot;;</span>
<span class="lineNum">     358 </span><span class="lineNoCov">          0 :   caffe_net.Backward();</span>
<span class="lineNum">     359 </span>            : 
<span class="lineNum">     360 </span>            :   const vector&lt;shared_ptr&lt;Layer&lt;float&gt; &gt; &gt;&amp; layers = caffe_net.layers();
<span class="lineNum">     361 </span>            :   const vector&lt;vector&lt;Blob&lt;float&gt;*&gt; &gt;&amp; bottom_vecs = caffe_net.bottom_vecs();
<span class="lineNum">     362 </span>            :   const vector&lt;vector&lt;Blob&lt;float&gt;*&gt; &gt;&amp; top_vecs = caffe_net.top_vecs();
<span class="lineNum">     363 </span>            :   const vector&lt;vector&lt;bool&gt; &gt;&amp; bottom_need_backward =
<span class="lineNum">     364 </span>            :       caffe_net.bottom_need_backward();
<span class="lineNum">     365 </span><span class="lineNoCov">          0 :   LOG(INFO) &lt;&lt; &quot;*** Benchmark begins ***&quot;;</span>
<span class="lineNum">     366 </span><span class="lineNoCov">          0 :   LOG(INFO) &lt;&lt; &quot;Testing for &quot; &lt;&lt; FLAGS_iterations &lt;&lt; &quot; iterations.&quot;;</span>
<span class="lineNum">     367 </span><span class="lineNoCov">          0 :   Timer total_timer;</span>
<span class="lineNum">     368 </span><span class="lineNoCov">          0 :   total_timer.Start();</span>
<span class="lineNum">     369 </span><span class="lineNoCov">          0 :   Timer forward_timer;</span>
<span class="lineNum">     370 </span><span class="lineNoCov">          0 :   Timer backward_timer;</span>
<span class="lineNum">     371 </span><span class="lineNoCov">          0 :   Timer timer;</span>
<span class="lineNum">     372 </span><span class="lineNoCov">          0 :   std::vector&lt;double&gt; forward_time_per_layer(layers.size(), 0.0);</span>
<span class="lineNum">     373 </span><span class="lineNoCov">          0 :   std::vector&lt;double&gt; backward_time_per_layer(layers.size(), 0.0);</span>
<span class="lineNum">     374 </span>            :   double forward_time = 0.0;
<span class="lineNum">     375 </span>            :   double backward_time = 0.0;
<span class="lineNum">     376 </span><span class="lineNoCov">          0 :   for (int j = 0; j &lt; FLAGS_iterations; ++j) {</span>
<span class="lineNum">     377 </span><span class="lineNoCov">          0 :     Timer iter_timer;</span>
<span class="lineNum">     378 </span><span class="lineNoCov">          0 :     iter_timer.Start();</span>
<span class="lineNum">     379 </span><span class="lineNoCov">          0 :     forward_timer.Start();</span>
<span class="lineNum">     380 </span><span class="lineNoCov">          0 :     for (int i = 0; i &lt; layers.size(); ++i) {</span>
<span class="lineNum">     381 </span><span class="lineNoCov">          0 :       timer.Start();</span>
<span class="lineNum">     382 </span><span class="lineNoCov">          0 :       layers[i]-&gt;Forward(bottom_vecs[i], top_vecs[i]);</span>
<span class="lineNum">     383 </span><span class="lineNoCov">          0 :       forward_time_per_layer[i] += timer.MicroSeconds();</span>
<span class="lineNum">     384 </span>            :     }
<span class="lineNum">     385 </span><span class="lineNoCov">          0 :     forward_time += forward_timer.MicroSeconds();</span>
<span class="lineNum">     386 </span><span class="lineNoCov">          0 :     backward_timer.Start();</span>
<span class="lineNum">     387 </span><span class="lineNoCov">          0 :     for (int i = layers.size() - 1; i &gt;= 0; --i) {</span>
<span class="lineNum">     388 </span><span class="lineNoCov">          0 :       timer.Start();</span>
<span class="lineNum">     389 </span>            :       layers[i]-&gt;Backward(top_vecs[i], bottom_need_backward[i],
<span class="lineNum">     390 </span><span class="lineNoCov">          0 :                           bottom_vecs[i]);</span>
<span class="lineNum">     391 </span><span class="lineNoCov">          0 :       backward_time_per_layer[i] += timer.MicroSeconds();</span>
<span class="lineNum">     392 </span>            :     }
<span class="lineNum">     393 </span><span class="lineNoCov">          0 :     backward_time += backward_timer.MicroSeconds();</span>
<span class="lineNum">     394 </span><span class="lineNoCov">          0 :     LOG(INFO) &lt;&lt; &quot;Iteration: &quot; &lt;&lt; j + 1 &lt;&lt; &quot; forward-backward time: &quot;</span>
<span class="lineNum">     395 </span><span class="lineNoCov">          0 :       &lt;&lt; iter_timer.MilliSeconds() &lt;&lt; &quot; ms.&quot;;</span>
<span class="lineNum">     396 </span>            :   }
<span class="lineNum">     397 </span><span class="lineNoCov">          0 :   LOG(INFO) &lt;&lt; &quot;Average time per layer: &quot;;</span>
<span class="lineNum">     398 </span><span class="lineNoCov">          0 :   for (int i = 0; i &lt; layers.size(); ++i) {</span>
<span class="lineNum">     399 </span>            :     const caffe::string&amp; layername = layers[i]-&gt;layer_param().name();
<span class="lineNum">     400 </span><span class="lineNoCov">          0 :     LOG(INFO) &lt;&lt; std::setfill(' ') &lt;&lt; std::setw(10) &lt;&lt; layername &lt;&lt;</span>
<span class="lineNum">     401 </span><span class="lineNoCov">          0 :       &quot;\tforward: &quot; &lt;&lt; forward_time_per_layer[i] / 1000 /</span>
<span class="lineNum">     402 </span><span class="lineNoCov">          0 :       FLAGS_iterations &lt;&lt; &quot; ms.&quot;;</span>
<span class="lineNum">     403 </span><span class="lineNoCov">          0 :     LOG(INFO) &lt;&lt; std::setfill(' ') &lt;&lt; std::setw(10) &lt;&lt; layername  &lt;&lt;</span>
<span class="lineNum">     404 </span><span class="lineNoCov">          0 :       &quot;\tbackward: &quot; &lt;&lt; backward_time_per_layer[i] / 1000 /</span>
<span class="lineNum">     405 </span><span class="lineNoCov">          0 :       FLAGS_iterations &lt;&lt; &quot; ms.&quot;;</span>
<span class="lineNum">     406 </span>            :   }
<span class="lineNum">     407 </span><span class="lineNoCov">          0 :   total_timer.Stop();</span>
<span class="lineNum">     408 </span><span class="lineNoCov">          0 :   LOG(INFO) &lt;&lt; &quot;Average Forward pass: &quot; &lt;&lt; forward_time / 1000 /</span>
<span class="lineNum">     409 </span><span class="lineNoCov">          0 :     FLAGS_iterations &lt;&lt; &quot; ms.&quot;;</span>
<span class="lineNum">     410 </span><span class="lineNoCov">          0 :   LOG(INFO) &lt;&lt; &quot;Average Backward pass: &quot; &lt;&lt; backward_time / 1000 /</span>
<span class="lineNum">     411 </span><span class="lineNoCov">          0 :     FLAGS_iterations &lt;&lt; &quot; ms.&quot;;</span>
<span class="lineNum">     412 </span><span class="lineNoCov">          0 :   LOG(INFO) &lt;&lt; &quot;Average Forward-Backward: &quot; &lt;&lt; total_timer.MilliSeconds() /</span>
<span class="lineNum">     413 </span><span class="lineNoCov">          0 :     FLAGS_iterations &lt;&lt; &quot; ms.&quot;;</span>
<span class="lineNum">     414 </span><span class="lineNoCov">          0 :   LOG(INFO) &lt;&lt; &quot;Total Time: &quot; &lt;&lt; total_timer.MilliSeconds() &lt;&lt; &quot; ms.&quot;;</span>
<span class="lineNum">     415 </span><span class="lineNoCov">          0 :   LOG(INFO) &lt;&lt; &quot;*** Benchmark ends ***&quot;;</span>
<span class="lineNum">     416 </span><span class="lineNoCov">          0 :   return 0;</span>
<span class="lineNum">     417 </span>            : }
<span class="lineNum">     418 </span><span class="lineCov">          3 : RegisterBrewFunction(time);</span>
<span class="lineNum">     419 </span>            : 
<span class="lineNum">     420 </span><span class="lineCov">          1 : int main(int argc, char** argv) {</span>
<span class="lineNum">     421 </span>            :   // Print output to stderr (while still logging).
<span class="lineNum">     422 </span><span class="lineCov">          1 :   FLAGS_alsologtostderr = 1;</span>
<span class="lineNum">     423 </span>            :   // Set version
<span class="lineNum">     424 </span><span class="lineCov">          2 :   gflags::SetVersionString(AS_STRING(CAFFE_VERSION));</span>
<span class="lineNum">     425 </span>            :   // Usage message.
<span class="lineNum">     426 </span><span class="lineCov">          2 :   gflags::SetUsageMessage(&quot;command line brew\n&quot;</span>
<span class="lineNum">     427 </span>            :       &quot;usage: caffe &lt;command&gt; &lt;args&gt;\n\n&quot;
<span class="lineNum">     428 </span>            :       &quot;commands:\n&quot;
<span class="lineNum">     429 </span>            :       &quot;  train           train or finetune a model\n&quot;
<span class="lineNum">     430 </span>            :       &quot;  test            score a model\n&quot;
<span class="lineNum">     431 </span>            :       &quot;  device_query    show GPU diagnostic information\n&quot;
<span class="lineNum">     432 </span><span class="lineCov">          1 :       &quot;  time            benchmark model execution time&quot;);</span>
<span class="lineNum">     433 </span>            :   // Run tool or show usage.
<span class="lineNum">     434 </span><span class="lineCov">          1 :   caffe::GlobalInit(&amp;argc, &amp;argv);</span>
<span class="lineNum">     435 </span><span class="lineCov">          1 :   if (argc == 2) {</span>
<span class="lineNum">     436 </span>            : #ifdef WITH_PYTHON_LAYER
<span class="lineNum">     437 </span>            :     try {
<span class="lineNum">     438 </span>            : #endif
<span class="lineNum">     439 </span><span class="lineCov">          2 :       return GetBrewFunction(caffe::string(argv[1]))();</span>
<span class="lineNum">     440 </span>            : #ifdef WITH_PYTHON_LAYER
<span class="lineNum">     441 </span>            :     } catch (bp::error_already_set) {
<span class="lineNum">     442 </span>            :       PyErr_Print();
<span class="lineNum">     443 </span>            :       return 1;
<span class="lineNum">     444 </span>            :     }
<span class="lineNum">     445 </span>            : #endif
<span class="lineNum">     446 </span>            :   } else {
<a name="447"><span class="lineNum">     447 </span><span class="lineNoCov">          0 :     gflags::ShowUsageWithFlagsRestrict(argv[0], &quot;tools/caffe&quot;);</span></a>
<span class="lineNum">     448 </span>            :   }
<span class="lineNum">     449 </span><span class="lineCov">          3 : }</span>
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
